package 笔试;

import java.util.Scanner;

public class Guanglianda {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int b = sc.nextInt();
        int[][] circle = new int[n][3];
        for (int i = 0; i < n; i++) {
            circle[i][0] = sc.nextInt();
            circle[i][1] = sc.nextInt();
            circle[i][2] = sc.nextInt();
        }

        for (int i = 1; i < n; i++) {
            if(circle[i-1][1]+circle[i][1]<=circle[i-1][2]+circle[i-1][2]){
                System.out.println(i);
            }
        }


        if(circle[0][2]>=b/2){
            System.out.println(0);
        }
    }
}
